// -----------------------------------------------
// Author:     code34 nicolas_boiteux@yahoo.fr
// Edited by:  Neumatic
// Warcontext: Unflip vehicle for engineer
// -----------------------------------------------

private ["_object","_list"];

_list = nearestObjects [getPosATL player, ["LandVehicle", "Air", "Tank", "Car"], 8];

if (count _list == 0) exitWith {
	wcgarbage = [localize "STR_WC_MENUUNFLIPVEHICLE", localize "STR_WC_MESSAGENOVEHICLENEARYOU", localize "STR_WC_MESSAGEGOCLOSERUNFLIP", 3] spawn WC_fnc_playerhint;
};

player playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 10;

if !(alive player) exitWith {};

_object = _list select 0;

wcflip = _object;
["wcflip", "server"] call WC_fnc_publicvariable;